home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
T-Z
/
XCMDInfo.cpt
/
CFlash.c
next >
Wrap
Text File
|
1989-02-26
|
2KB
|
63 lines
/*
CFlash -- a sample HyperCard user-defined command in C.
©Apple Computer, Inc. 1987
All Rights Reserved.
To compile and link this file using Macintosh Programmer's Workshop,
C -q2 Cflash.c
link -sn Main=Cflash -sn STDIO=Cflash ∂
-sn INTENV=Cflash -rt XCMD=5 ∂
Cflash.c.o -o HyperCommands
If your program user parts of the C Library, use this link instead:
link -sn Main=Cflash -sn STDIO=Cflash ∂
-sn INTENV=Cflash -rt XCMD=5 ∂
-m CFLASH Cflash.c.o "{CLibraries}"CRuntime.o ∂
"{CLibraries}"CInterface.o ∂
-o HyperCommands
This link directive puts the XCMD in the file "HyperCommands".
Substitute the name of the stack you want it in. To move XCMDs
between stacks, use ResEdit. They can be in an individual stack,
the Home stack, the HyperCard application, or the System File.
(XCMD=0 for flash from Pascal, =5 for cFlash from C)
(XCMD=11 Panasonic, =12 Hitachi, =13 Phillips, =14 PioneerLDV6000,
=15 PioneerLVP4200, =20 SoundCapToRes)
*/
#include <Types.h>
#include <Memory.h>
#include <OSUtils.h>
#include <QuickDraw.h>
#include <HyperXCmd.h>
pascal void Debugger() extern 0xA9FF;
/* **** WARNING: DO NOT USE GLOBAL VARIABLES! **** */
pascal void CFlash(paramPtr)
XCmdBlockPtr paramPtr;
{
short flashCount,again;
GrafPtr port;
Str255 str;
/* First param is flash count. Convert it to a pascal string */
ZeroToPas(paramPtr,*(paramPtr->params[0]),&str);
/* Convert the string to a number */
flashCount = StrToNum(paramPtr,&str);
GetPort(&port);
for (again = 1; again <= flashCount; again++)
{
InvertRect(&port->portRect);
InvertRect(&port->portRect);
}
}
/* C routines for HyperCard callbacks */
#include <XCmdGlue.inc.c>